<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'user.label', default: 'user')}"/>
    <title>修改企业认证信息</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li class="active">
                        <span>修改企业认证信息</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                修改企业认证信息
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${this.certificate}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.certificate}" var="error">
                    <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                        <g:message error="${error}"/>
                    </li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <div class="hpanel hblue">
            <div class="panel-heading">
                修改企业认证信息
            </div>

            <div class="panel-body">
                <g:form resource="${this.certificate}" method="PUT" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-md-2 control-label">公司名称</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="account" value="${certificate?.account?.id}"
                                      optionKey="id" optionValue="name" from="${com.next.Account.list()}" disabled="true"/>
                        </div>
                        <label class="col-md-2 control-label">认证时间</label>

                        <div class="col-md-3 datePicker">
                            <g:datePicker name="startTime"  value="${certificate?.startTime}" precision="day"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">认证机构</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="certificateAuthority" id="certificateAuthority" value="${certificate?.certificateAuthority}"/>
                        </div>
                        <label class="col-md-2 control-label">证书名称</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="name" id="name" value="${certificate?.name}"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">认证部门</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="certificateDepartment" id="certificateDepartment" value="${certificate?.certificateDepartment}"/>
                        </div>
                        <label class="col-md-2 control-label">认证类型</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="type" value="${certificate?.type?.id}"
                                      optionKey="id" optionValue="name" from="${com.next.CertificateType.list()}"
                                      noSelection="['': '-请选择-']"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">登记日期</label>

                        <div class="col-md-3 datePicker">
                            <g:datePicker name="registerDate"  precision="day" value="${certificate?.registerDate}"/>
                        </div>
                        <label class="col-md-2 control-label">登记机构</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerAccount" id="registerAccount" value="${certificate?.registerAccount}"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">登记人</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerUser" id="registerUser" value="${certificate?.registerUser}"/>
                        </div>
                        <label class="col-md-2 control-label">有效日期</label>

                        <div class="col-md-3 datePicker">
                            <g:datePicker name="endTime"  precision="day" value="${certificate?.endTime}"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">更新日期</label>

                        <div class="col-md-3 datePicker">
                            <g:datePicker name="modifiedDate"  value="${certificate?.modifiedDate}" precision="day"/>
                        </div>
                    </div>
                    <g:hiddenField name="targetUri"  value="${targetUri}"/>
                    <g:hiddenField name="account.id"  value="${this?.certificate?.account?.id}"/>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-md-1 col-md-offset-5">
                            <button class="btn btn-info" type="submit">保存</button>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
